package com.smartgame.controllers;

import java.util.ArrayList;
import java.util.List;

import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.InputAdapter;
import com.smartgame.objects.AbstractObject;
import com.smartgame.util.CameraHelper;

public abstract class AbstractController extends InputAdapter {

	public static final String TAG = GameController.class.getName();
	
	public List<AbstractObject> rendererList = new ArrayList<AbstractObject>();
	public CameraHelper cameraHelper;
	
	protected Game game;

	public AbstractController(Game game) {
		this.game = game;
		init();
	}

	private void init() {
		Gdx.input.setInputProcessor(this);
		cameraHelper = new CameraHelper();
	}

	public void update(float deltaTime) {
		// update objects
		for (AbstractObject obj : rendererList) {
			obj.update(deltaTime);
		}

		// update camera
		cameraHelper.update(deltaTime);
	}
	
}
